<link href="<?=site_url()?>css/jquery.simplyscroll-1.0.4.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="<?=site_url()?>js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?=site_url()?>js/jquery.simplyscroll-1.0.4.min.js"></script>
<style>
.simply-scroll{
	width: 450px;
}
.simply-scroll-btn {
	height: 27px;
	width: 26px;
}
.simply-scroll-btn-right {
	background-image:url("<?=site_url()?>images/presentstudent_19_08.jpg");
	top: 0px;
	right: 10px;
}
.simply-scroll-btn-left {
	background-image:url("<?=site_url()?>images/presentstudent_19_06.jpg");
	top: 0px;
	left: 10px;
}
.simply-scroll-list {
	top: 30px;
	left: 0px;
}
.simply-scroll .simply-scroll-clip {
height:60px;
width:400px;
left:30px;
}
ul li{
	margin:0;
	padding:0;
	list-style: none;
}
</style>
<script type="text/javascript">
(function($) {
	$(function() { //on DOM ready
		$("#scroller").simplyScroll({
			speed: 8
		});
	});
})(jQuery);

var currentStu = 0;
var t;
function timedCount()
{
	if(currentStu >= document.getElementsByName("gstu").length) {
		currentStu = 0;
	}
	changeImg(document.getElementsByName("gstu")[currentStu]);
	currentStu++;

	t = setTimeout("timedCount()",3000);
}

function changeImg(obj) {
	var imgPath = obj.src;
	document.getElementById("feedDiv").innerHTML = '<img src="'+imgPath+'" width="169" height="193" />';
	document.getElementById("feedTxt").innerHTML = '<span class="style2">' + document.getElementById("de"+obj.id).value + '</span>';
	for(var i = 0; i < document.getElementsByName("gstu").length; i++) {
		if(obj == document.getElementsByName("gstu")[i]) {
			currentStu = i;
		}
	}
}

</script>

<table width="915" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td width="86"><img src="<?=site_url()?>images/presentstudent_14.jpg" width="86" height="860" alt="" /></td>
        <td width="739" valign="top" bgcolor="#FFFFFF"><table width="739" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="618" height="125"><table id="Table_01" width="617" height="125" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="125" rowspan="2" bgcolor="#FFFFFF"><img src="<?=site_url()?>images/presentstudent_16_01.jpg" width="124" height="125" alt="" /></td>
                <td height="86"><img src="<?=site_url()?>images/presentstudent_16_02.jpg" width="493" height="86" alt="" /></td>
              </tr>
              <tr>
                <td width="493" height="39" bgcolor="#FFFFFF"><table width="305" border="0" align="left" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><p class="style2">&nbsp;&nbsp;น้องๆ  สามารถตรวจสอบสถานะการสมัครเรียนได้ที่หน้านี้นะคะ </p></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
            <td width="121" height="125" bgcolor="#FFFFFF"><img src="<?=site_url()?>images/registertutor_16.jpg" width="121" height="125" alt="" /></td>
          </tr>
          <tr>
            <td height="218" colspan="2"><table id="Table_" width="400" height="218" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="11" colspan="6"><img src="<?=site_url()?>images/presentstudent_19_01.jpg" width="739" height="11" alt="" /></td>
                <td width="1"><img src="<?=site_url()?>images/spacer.gif" width="1" height="11" alt="" /></td>
              </tr>
              <tr>
                <td width="44" height="214" rowspan="5"><img src="<?=site_url()?>images/presentstudent_19_02.jpg" width="44" height="214" alt="" /></td>
                <td width="169" rowspan="2" height="193">
                	<div id="feedDiv" style="float:left; z-index:200;">
						<img src="<?=site_url()?>data-image/good-student/<?php echo $feedback[0]->student_path;?>" width="169" height="193" />
					</div>
					<div style="float:left; margin-top:-195px;">
						<img alt="" src="<?=site_url()?>images/presentstudent_19_03.png"  width="169" height="195" />
					</div>
                </td>
                <td colspan="3" bgcolor="#FFFFFF"><table width="295" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><table width="295" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td id="feedTxt" style="word-wrap: break-word;"><span class="style2"><?php echo $feedback[0]->detail;?></span></td>    
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
                <td width="51" height="214" rowspan="5"><img src="<?=site_url()?>images/presentstudent_19_05.jpg" width="50" height="214" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="120" alt="" /></td>
              </tr>
              <tr height="80px">
              	<td colspan="4">
	              	<ul id="scroller" style="height: 50px;">
		    			<?php for($i = 0; $i < count($feedback); $i++) { if($feedback[$i]->student_path == null) continue; ?>
				 		<li>
					 		<img name="gstu" id="<?php echo $feedback[$i]->good_student_id;?>" src="<?=site_url()?>data-image/good-student/<?php echo $feedback[$i]->student_path;?>" height="31" width="28" alt="<?php echo $feedback[$i]->student_name;?>" onclick="changeImg(this);" />
							<input type="hidden" value="<?php echo $feedback[$i]->detail;?>" id="de<?php echo $feedback[$i]->good_student_id;?>"/>		 		
				 		</li>
			 			<?php } ?>
		    		</ul>
              	</td>
              </tr>
              <tr>
                <td rowspan="2"><img src="<?=site_url()?>images/presentstudent_19_10.jpg" width="169" height="14" alt="" /></td>
                <td width="475"><img src="<?=site_url()?>images/spacer.gif" width="1" height="1" alt="" /></td>
              </tr>
              <tr>
                <td colspan="3"><img src="<?=site_url()?>images/presentstudent_19_11.jpg" width="475" height="13" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="13" alt="" /></td>
              </tr>
            </table></td>
            </tr>
          <tr>
            <td colspan="2"><table id="Table_2" width="739" height="468" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="75"><img src="<?=site_url()?>images/presentstudent_20_01.jpg" width="739" height="75" alt="" /></td>
              </tr>
              
              <?php $i = 0; 
              	for(; $i < count($students); $i++) {?>	
              <tr>
               	<td width="739" height="18"><img src="<?=site_url()?>images/presentstudent_20_02_01.jpg" width="739" height="18" alt="" /></td>
              </tr>
              <tr>
               	<td width="739" height="26" background="<?=site_url()?>images/presentstudent_20_02_02.jpg">
               		<table width="660" border="0" cellspacing="0" cellpadding="0" align="center" class="style2">
						<tr>
							<td width="145"  align="center" valign="middle"><?=$students[$i]->school?></td>
							<td width="60"  align="center" valign="middle"><?=$students[$i]->current_class?></td>
							<td width="155"  align="left" valign="middle"><?=$students[$i]->first_name?></td>
							<td width="60"  align="center" valign="middle"><?=$students[$i]->nick_name?></td>
							<td   align="center" valign="middle"><?php if(((strtotime(substr($students[$i]->create_date,0,-9)) - strtotime(date('Y-m-d')))/( 60 * 60 * 24 ))>7) { echo $students[$i]->maching_status; }else{ echo 'อยู่ระหว่างการเรียนการสอน';} ?></td>
						</tr>
					</table>
				</td>
              </tr>
              <tr>
               	<td width="739" height="16"><img src="<?=site_url()?>images/presentstudent_20_02_03.jpg" width="739" height="16" alt="" /></td>
              </tr>
              <?php } 
              if($i < 6) {
              	while($i != 6) { $i++; ?>
              		  <tr>
		               	<td width="739" height="18"><img src="<?=site_url()?>images/presentstudent_20_02_01.jpg" width="739" height="18" alt="" /></td>
		              </tr>
		              <tr>
		               	<td width="739" height="26" background="<?=site_url()?>images/presentstudent_20_02_02.jpg"></td>
		              </tr>
		              <tr>
		               	<td width="739" height="16"><img src="<?=site_url()?>images/presentstudent_20_02_03.jpg" width="739" height="16" alt="" /></td>
		              </tr>
             <?php 	} } ?>
              <tr>
                <td height="33"><img src="<?=site_url()?>images/presentstudent_20_03.jpg" width="739" height="33" alt="" /></td>
              </tr>
            </table></td>
            </tr>
          <tr>
            <td colspan="2"><table width="739" border="0" cellspacing="0" cellpadding="0">
              <tr align="center">
                <td height="28" bgcolor="#FFFFFF" class="style1"><span class="style2"><?php echo $paging;?></span></td>
              </tr>
              </table></td>
          </tr>
          </table></td>
        <td width="90"><img src="<?=site_url()?>images/presentstudent_18.jpg" width="90" height="860" alt="" /></td>
      </tr>
    </table>
    
<script type="text/javascript">
	$.fx.speeds._default = 1000;
	$(function() {
		timedCount();
	});

</script>

    